package com.poorstu.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

import com.common.base.web.BaseAction;
import com.poorstu.manager.LeaseManager;

public class LoadMoneyChangeAction extends BaseAction {

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		try{  
			
			//loadmoney 由于功能很少 写到lease里面 共用一个dao
			DynaActionForm dyna =(DynaActionForm)form;
			int moneyId=(Integer)dyna.get("moneyId");
			int loadMoney=(Integer)dyna.get("loadMoney");
			
			LeaseManager leaseMag=(LeaseManager)getBean("leaseManager");
			leaseMag.updateLoadMoney(moneyId, loadMoney);
			
		    return mapping.findForward("succ");
		}catch(Exception e){
			e.printStackTrace();
			return mapping.findForward("failure");
		}
		
	}
	
}
